package com.partner.springsecurity;

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

import org.springframework.security.access.*;
import org.springframework.security.web.access.*;

import com.partner.frame.support.util.*;

public class SysAccessDeniedHandler implements AccessDeniedHandler
{
   
   public void handle(HttpServletRequest httpRequest, HttpServletResponse httpResponse, AccessDeniedException deniedException) throws IOException, ServletException
   {
      Map<String,Object> mapResult = new HashMap<String,Object>();
      
      System.out.println("SysAccessDeniedHandler::handle - " + deniedException.toString());
      
      mapResult.put("resultStatus", false);
      mapResult.put("resultMessage", "您没有操作权限，请联系管理员！");
      
      //throw deniedException;
      JsonUtil.outJson(mapResult, httpResponse);
      
      return ;
   }

}
